69 #define TIMER_A_PERIOD 80
74 WDT_A_hold(WDT_A_BASE);
89 ADC10_A_init(ADC10_A_BASE,
90 ADC10_A_SAMPLEHOLDSOURCE_SC,
91 ADC10_A_CLOCKSOURCE_ADC10OSC,
92 ADC10_A_CLOCKDIVIDER_1);
94 ADC10_A_enable(ADC10_A_BASE);
101 ADC10_A_setupSamplingTimer(ADC10_A_BASE,
102 ADC10_A_CYCLEHOLD_16_CYCLES,
103 ADC10_A_MULTIPLESAMPLESDISABLE);
112 ADC10_A_configureMemory(ADC10_A_BASE,
115 ADC10_A_VREFNEG_AVSS);
118 ADC10_A_clearInterrupt(ADC10_A_BASE,
120 ADC10_A_enableInterrupt(ADC10_A_BASE,
125 while ( REF_BUSY == Ref_isRefGenBusy(REF_BASE) ) ;
127 Ref_setReferenceVoltage(REF_BASE,
130 Ref_enableReferenceVoltage(REF_BASE);
134 Timer_A_initUpModeParam initUpParam = {0};
135 initUpParam.clockSource = TIMER_A_CLOCKSOURCE_SMCLK;
136 initUpParam.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
138 initUpParam.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
139 initUpParam.captureCompareInterruptEnable_CCR0_CCIE =
140 TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE;
141 initUpParam.timerClear = TIMER_A_SKIP_CLEAR;
142 initUpParam.startTimer =
true;
143 Timer_A_initUpMode(TIMER_A1_BASE, &initUpParam);
147 __bis_SR_register(CPUOFF + GIE);
150 Timer_A_disableCaptureCompareInterrupt(TIMER_A0_BASE,
151 TIMER_A_CAPTURECOMPARE_REGISTER_0);
160 ADC10_A_startConversion(ADC10_A_BASE,
161 ADC10_A_SINGLECHANNEL);
164 __bis_SR_register(CPUOFF + GIE);
173 #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
174 #pragma vector=ADC10_VECTOR
176 #elif defined(__GNUC__)
177 __attribute__((interrupt(ADC10_VECTOR)))
181 switch (__even_in_range(ADC10IV,12)){
192 if (ADC10_A_getResults(ADC10_A_BASE) < 0x155){
215 #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
217 #elif defined(__GNUC__)
218 __attribute__((interrupt(TIMER0_A0_VECTOR)))
222 Timer_A_stop(TIMER_A0_BASE);
__bic_SR_register_on_exit(LPM3_bits|GIE)
GPIO_setOutputHighOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)
GPIO_setOutputLowOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)